Technical Q&As
The Apple Media Tool and Apple Media Tool Programming Environment products have been discontinued.
For more information check out: AMT/PE Discontinued.
AMT_PE 16 - A Method for AMT to "remember" Changes Made on Screen (1-Aug-95)
Q I'm working on a project that requires the user to make selections on Screen1,
then travel to Screen2. But I need AMTPE to "remember" the selections the user
made on Screen1. Upon returning to Screen1 from Screen2, the selections
initially made on Screen1 must show, for example, that the user moved an object
from the default coordinates(100,100) to (150,150). How do I store the new
Object Coordinates and have the Object recall the new coordinates instead of
the default coordinates when you return to this screen?
Screen1 code looks like this:
object MoveMe is MediaScroller
has
MouseDown(theX, theY)
do
self.moveto(theX, theY);
end;
-- stuff here
with
X is 100, Y is 100 --etc.
end;
When I leave Screen1, then return the object, MoveMe has returned to its
initial Coordinates of x=100 and Y=100. Is there a way for AMT to "remember"
changes made on a Screen?
A After you use MoveTo to move your object from 100,100 to 150,150, add these
lines:
Self.StartX := Self.X;
Self.StartY := Self.Y;
StartX and StartY determine where the object is initially drawn on the screen.
Change them and it should behave the way you want when you return to the screen.
Technical Q&As
Previous Question | Contents | Next Question